package com.cb.domain.model.system;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;




/**
 * Model class for AppResource. Add not database mapped fileds in this class.
 */
@Entity
@Table(name="app_resource")
public class AppResource implements Serializable {
	
		protected Long resourceId;
		protected String resourceName;
		protected String resourceTitle;
		protected String resourceUrl;
		protected String resourceDesc;
		protected Long parentId;
		protected String path;
		
//		private Set<AppRole> roles=new java.util.HashSet();
		
//		@ManyToMany(fetch=FetchType.EAGER)
//		@JoinTable(name="role_res",joinColumns={@JoinColumn(name="roleId")},inverseJoinColumns={@JoinColumn(name="resourceId")})
//		public Set<AppRole> getRoles() {
//			return roles;
//		}
//		public void setRoles(Set<AppRole> roles) {
//			this.roles = roles;
//		}

		public static final String RESOURCE_ALL = "All";
		
		@Id     
	    @GeneratedValue(generator="Id_Generator")
	    @GenericGenerator(name="Id_Generator", strategy="com.cb.common.util.IdGenerator")
		@Column(name="resourceId")   
		public Long getResourceId() {
			return resourceId;
		}

		public void setResourceId(Long resourceId) {
			this.resourceId = resourceId;
		}
		
		@Column(name = "resourceName")
		public String getResourceName() {
			return resourceName;
		}

		public void setResourceName(String resourceName) {
			this.resourceName = resourceName;
		}

		@Column(name = "resourceTitle")
		public String getResourceTitle() {
			return resourceTitle;
		}

		public void setResourceTitle(String resourceTitle) {
			this.resourceTitle = resourceTitle;
		}

		@Column(name = "resourceUrl")
		public String getResourceUrl() {
			return resourceUrl;
		}

		public void setResourceUrl(String resourceUrl) {
			this.resourceUrl = resourceUrl;
		}

		@Column(name = "resourceDesc")
		public String getResourceDesc() {
			return resourceDesc;
		}

		public void setResourceDesc(String resourceDesc) {
			this.resourceDesc = resourceDesc;
		}

		@Column(name = "parentId")
		public Long getParentId() {
			return parentId;
		}

		public void setParentId(Long parentId) {
			this.parentId = parentId;
		}

		@Column(name = "path")
		public String getPath() {
			return path;
		}

		public void setPath(String path) {
			this.path = path;
		}
}
